.toolbar {
  display: flex;
  align-items: center;
  background-color: transparent;
  padding: 8px;
  position: relative;
}

/* 移除悬浮相关样式 */
.toolbar.position-top,
.toolbar.position-bottom,
.toolbar.position-left,
.toolbar.position-right {
  position: static;
  transform: none;
}

.toolbar.position-top {
  top: 25px; /* 从15px增加到25px */
  left: 50%;
  transform: translateX(-50%);
}

.toolbar.position-bottom {
  bottom: 25px; /* 从15px增加到25px */
  left: 50%;
  transform: translateX(-50%);
}

.toolbar.position-left {
  left: 25px; /* 从15px增加到25px */
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
}

.toolbar.position-right {
  right: 25px; /* 从15px增加到25px */
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
}

/* 左侧和右侧位置的分隔符样式 */
.toolbar.position-left .toolbar-divider,
.toolbar.position-right .toolbar-divider {
  width: 24px;
  height: 1px;
  margin: 8px 0;
}

/* 位置切换按钮 */
.toolbar-position-toggle {
  position: absolute;
  width: 24px;
  height: 24px;
  background-color: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: #555;
  z-index: 1001;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
}

.toolbar-position-toggle:hover {
  background-color: #eeeeee;
  transform: scale(1.1);
}

.toolbar.position-top .toolbar-position-toggle {
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
}

.toolbar.position-bottom .toolbar-position-toggle {
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
}

.toolbar.position-left .toolbar-position-toggle {
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
}

.toolbar.position-right .toolbar-position-toggle {
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
}

.toolbar-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: transparent;
  border: none;
  margin: 0 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.toolbar-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.toolbar-button:active {
  background-color: rgba(0, 0, 0, 0.1);
  transform: scale(0.95);
}

.toolbar-button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.toolbar-button .icon {
  font-size: 18px;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background-color: #e0e0e0;
  margin: 0 8px;
}

/* 为按钮添加悬停提示 */
.toolbar-button::after {
  content: attr(title);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 100;
  pointer-events: none;
  margin-top: 5px;
}

.toolbar-button:hover::after {
  opacity: 1;
  visibility: visible;
}

/* 调整布局选择器在工具栏中的样式 */
.toolbar .layout-selector {
  margin-left: 0;
}

.toolbar.position-left .layout-selector,
.toolbar.position-right .layout-selector {
  margin-top: 5px;
}

/* 垂直方向的布局选择器下拉菜单调整 */
.toolbar.position-left .layout-dropdown {
  left: 100%;
  top: 0;
  margin-left: 10px;
  margin-top: 0;
}

.toolbar.position-right .layout-dropdown {
  right: 100%;
  top: 0;
  margin-right: 10px;
  margin-top: 0;
  left: auto;
}

/* 垂直方向排列时的按钮样式调整 */
.toolbar.position-left .toolbar-button,
.toolbar.position-right .toolbar-button {
  margin: 2px 0;
}

/* 删除拖动手柄相关样式 */
.toolbar-drag-handle {
  display: none;
}

.mind-map-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(230, 230, 230, 0.8);
  padding: 5px 0;
  display: flex;
  justify-content: center;
}

/* 适应Toolbar的样式 */
.mind-map-header .toolbar {
  position: relative;
  padding: 5px 10px;
  border-radius: 4px;
  box-shadow: none;
  background-color: transparent;
  border: none;
  width: auto;
}

/* 去除工具栏中的可拖动元素和位置切换按钮 */
.toolbar-drag-handle,
.toolbar-position-toggle {
  display: none;
}

.layout-selector {
  position: relative;
  margin-left: 10px;
}

.layout-button {
  padding: 5px 10px;
  background-color: #4285f4;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.layout-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 5px;
  width: 320px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 100;
  padding: 15px;
}

.layout-options h3 {
  font-size: 16px;
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.layout-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.layout-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.layout-item:hover {
  background-color: #f5f5f5;
  transform: translateY(-1px);
}

.layout-item.active {
  background-color: #e3f2fd;
  border-left: 3px solid #4285f4;
}

.layout-preview {
  font-size: 20px;
  margin-right: 12px;
  color: #4285f4;
  width: 40px;
  text-align: center;
}

.layout-name {
  font-weight: 500;
  margin-bottom: 2px;
}

.layout-description {
  font-size: 12px;
  color: #666;
  line-height: 1.3;
}

.layout-settings {
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.layout-settings h4 {
  font-size: 14px;
  margin: 0 0 10px 0;
}

.setting-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.setting-item label {
  width: 70px;
  font-size: 14px;
}

.setting-item input {
  flex: 1;
  margin: 0 10px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #ddd;
  outline: none;
  border-radius: 3px;
}

.setting-item input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4285f4;
  cursor: pointer;
}

.setting-item span {
  width: 50px;
  text-align: right;
  font-size: 14px;
}

.layout-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 15px;
  gap: 10px;
}

.layout-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: #f5f5f5;
  transition: all 0.2s;
}

.layout-actions button:hover {
  background-color: #e0e0e0;
}

.layout-actions .apply-button {
  background-color: #4285f4;
  color: white;
}

.layout-actions .apply-button:hover {
  background-color: #3367d6;
}

/* 下拉菜单容器 */
.toolbar-item-container {
  position: relative;
}

.dropdown-container {
  position: relative;
}

/* 下拉菜单样式 */
.toolbar-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  min-width: 180px;
  z-index: 1100;
  margin-top: 5px;
  padding: 5px 0;
}

/* 下拉菜单项样式 */
.dropdown-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  width: 100%;
  background: #4285f4;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: white;
  transition: background-color 0.2s;
  margin-bottom: 2px;
  border-radius: 4px;
}

.dropdown-item:hover {
  background-color: #3367d6;
}

.dropdown-item.disabled {
  background-color: #cccccc;
  color: #f0f0f0;
  cursor: not-allowed;
}

.dropdown-icon {
  margin-right: 8px;
  font-size: 16px;
}

.dropdown-label {
  flex-grow: 1;
}

/* 下拉菜单容器样式调整 */
.toolbar-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  min-width: 180px;
  z-index: 1100;
  margin-top: 5px;
  padding: 8px;
}

/* 活动状态的下拉按钮 */
.toolbar-button.active {
  background-color: rgba(66, 133, 244, 0.2);
  border: 1px solid rgba(66, 133, 244, 0.4);
}
